<style type="text/css">
    .uploadify-button {
        left: 0;
        width: 85px;
        height: 28px;
        background-repeat: no-repeat;
        border: none;
        padding: 0;
    }

    .uploadify:hover .uploadify-button {
        background-repeat: no-repeat;
        width: 85px;
        height: 28px;
    }

    .fileQueue {
        background-color: #F4F9FF;
        height: 55px;
        overflow: auto;
        width: 70%;
    }
</style>
<script type="text/javascript">
    $(function () {
        $("#xsht_gspzList").datagrid({
            url: $.webPath() + '/base/gspz/gspzList01',
            fit: true,
            fitColumns: true,
            singleSelect: true,
            checkbox: true,
            checkOnSelect: true,
            selectOnCheck: true,
            showFooter: false,
            rownumbers: false,
            columns: [
                [
                    {field: 'checked', checkbox: true},
                    {field: 'id', title: 'ID', hidden: true, width: 100, align: 'center'},
                    {field: 'mc', title: '公式名称', width: 100, formatter: gspzCell},
                    {field: 'szr_xm', title: '设置人', width: 100},
                    {field: 'jzrq', title: '截止日期', width: 100},
                    {field: 'sfqy', title: '启用', width: 100,
                        formatter: function (value) {
                            if (value == '是')
                                return '是';
                            else
                                return '否';
                        }
                    }
                ]
            ]
        })
    })
</script>
<script type="text/javascript" src="${base}/scripts/tool/htdygl.js"></script>
<script type="text/javascript" src="${base}/scripts/htgl/xshtcontent.js"></script>
<form id="xshtglForm" method="post" class="easyui-tabs" fit="true">
<input id="xsht_htbm" type="hidden" value="${(xshtHtbm)!''}"/>
<input id="xsht_emwtime" type="hidden" value="${(xshtEmwtime)!''}"/>
<input name="xsht.id" type="hidden" value="${(xsht.id)!''}"/>
<input id= "xsht_bzjfs"  type="hidden" value="${(cght.bzjfs)!''}"/>
<input id="xsht_htms" type="hidden" name="xsht.htms" value="${(xsht.htms)!''}"/>
<input id="xsht_orderid" type="hidden" name="xsht.orderId" value="${(xsht.orderId)!''}"/>
<input id="xsht_sfjs" type="hidden" name="xsht.sfjs" value="${(xsht.sfjs)!''}"/>
<input name="xsht.xsxt_htbm" type="hidden" value="${(xsht.xsxt_htbm)!''}"/>
<input name="htdyId" type="hidden" value="${(htdyId)!''}"/>
<input type="hidden" id="xsht_zgjgId" value="${(gsId)!}"/>
<input type="hidden" id="xsht_zggsId" value="${(zggsId)!}"/>
<input type="hidden" name="xsht.zddhcght.id" value="${(xsht.zddhcght.id)!}"/>
<input type="hidden" id="xsht_gspz" name="xsht.gspz.id" value="${(xsht.gspz.id)!}"/>
<input type="hidden" id="xsht_xy" value="<#if xsht?? && xsht.xy??>true<#else>false</#if>"/>
<input id="xsht_sbbm_id" name="xsht.sbbm.id"
       value="<#if xsht??>${(xsht.sbbm.id)!}<#else>${(yg.zgjg.id)!}</#if>" type="hidden"/>

<div title="合同信息" style="height: 100%;overflow-y: auto">
    <table style="width:98%" class="tb tab-t">
        <col width="70px"/>
        <col width=""/>
        <col width="90px"/>
        <col width=""/>
        <col width="70px"/>
        <col width=""/>
        <tr id="lj_display">
            <th style="color:#f45212;">路&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;径：</th>
            <td colspan="5" style="font-weight: bold">
            <#if xsht?? && xsht.lj??>
            ${(xsht.lj.mc)!}
                <input type="hidden" name="xsht.lj.id" value="${(xsht.lj.id)!}"/>
            <#else>
                <input id="xsht_lj_id" name="xsht.lj.id" type="text" value="${(xsht.lj.id)!}" required="true"
                       class="input-text" missingMessage="路径不能为空！"
                       style="width: 490px"/>
            </#if>
            </td>
        </tr>
        <tr>
            <th>合同类型：</th>
            <td>
                <input type="hidden" name="xsht.xslx" value="${(xsht.xslx)!}"/>
                <input type="text" class="input-text" id="xsht_xslx_mc"
                       value="<#if xsht??><#if xsht.xslx=='kcxs'>库存销售<#else>直达到货</#if></#if>" readonly="readonly"/>
            </td>

            <th>客&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;户：</th>
            <td>
                <input id="xsht_hzf_id" name="xsht.hzf.id" type="easyui-combobox text" value="${(xsht.hzf.id)!}"
                       class="input-text" required="true"/>
            </td>

        </tr>
        <tr>
            <th>签订日期：</th>
            <td>
                <input name="xsht.qdrq" class="easyui-datebox input-text" required="true"
                       value="<#if xsht??>${(xsht.qdrq?date)!}<#else>${startDate?date}</#if>"/>
            </td>
            <th>签订地点：</th>
            <td>
                <input name="xsht.qddd" type="text" class="input-text"" value="${(xsht.qddd)!}"/>
            </td>

            <th>回款方式：</th>
            <td>
                <input id="xsht_fkfs_id" name="xsht.fkfs.id" type="text" value="${(xsht.fkfs.id)!}"
                       class="input-text"/>
            </td>
        </tr>
        <tr>
            <th>交货时间：</th>
            <td>
                <input name="xsht.jhsj" class="easyui-datebox input-text"
                       value="<#if xsht??>${(xsht.jhsj?date)!}<#else>${startDate?date}</#if>"/>
            </td>
            <th>交货地点：</th>
            <td>
                <input name="xsht.jhdd" class="input-text" value="${(xsht.jhdd)!}"/>
            </td>

            <th>交货方式：</th>
            <td>
                <input id="xsht_jhfs" name="xsht.jhfs" class="input-text" value="${(xsht.jhfs)!}"/>
            </td>
        </tr>
        <tr>
            <th>税&nbsp;率(%)：</th>
            <td>
                <input id="xsht_sl" name="xsht.sl" class="easyui-combobox input-text" type="text"
                       value="<#if xsht??>${(xsht.sl?string("0.0000"))!}<#else>17.0000</#if>"/>
            </td>
            <th>结束日期：</th>
            <td>
                <input name="xsht.jsrq" class="easyui-datebox input-text"
                       value="<#if xsht??>${(xsht.jsrq?date)!}<#else>${startDate?date}</#if>"/>
            </td>
            <th>发运责任：</th>
            <td>
                <input name="xsht.fhzr.id" type="text" value="${(xsht.fhzr.id)!}" class="input-text"/>
            </td>
        </tr>
        <tr>
            <th>工&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;程：</th>
            <td>
                <input id="xsht_gc_id" name="xsht.gc.id" type="text"
                       value="${(xsht.gc.id)!}" class="input-text"/>
            </td>
            <th>销售费用：</th>
            <td>
                <input name="xsht.xsfy.id" type="text" class="input-text" value="${(xsht.xsfy.id)!}"/>
            </td>
            <th>合同性质：</th>
            <td>
                <input name="xsht.htxz.id" type="text" value="${(xsht.htxz.id)!}" class="input-text"/>
            </td>
        </tr>
    <#--<tr>
        <th>回款依据：</th>
        <td>
            <input id="xsht_jsyj_id" name="xsht.jsyj.id" class="input-text" value="${(xsht.jsyj.id)!}"/>
        </td>
        <th>回款期限(天)：</th>
        <td>
            <input id="xsht_hkqx" name="xsht.hkqx" class="easyui-numberbox input-text" type="text"
                   value="${(xsht.hkqx)!}" required="true"
                   data-options="precision:0,min:0"/>
        </td>
        <th>发运责任：</th>
        <td>
            <input name="xsht.fhzr.id" type="text" value="${(xsht.fhzr.id)!}" class="input-text"/>
        </td>
    </tr>-->
        <tr>
            <th>申报公司：</th>
            <td>
                <input id="xsht_sbgs_jc" type="text" class="input-text" readonly="true"
                       value="<#if xsht??>${(xsht.sbgs.jc)!}<#else>${(yg.zggs.jc)!}</#if>"/>
                <input id="xsht_sbgs_id" name="xsht.sbgs.id"
                       value="<#if xsht??>${(xsht.sbgs.id)!}<#else>${(yg.zggs.id)!}</#if>" type="hidden"/>
            </td>
            <th>申&nbsp;报&nbsp;&nbsp;人：</th>
            <td>
                <input type="hidden" id="xsht_sbr_id" name="xsht.sbr.id"
                       value="<#if xsht??>${(xsht.sbr.id)!}<#else>${(yg.id)!}</#if>"/>
                <input id="xsht_sbr_xm" type="text" class="input-text" readonly="readonly"
                       value="<#if xsht??>${(xsht.sbr.xm)!}<#else>${(yg.xm)!}</#if>"/>
            </td>
            <th>销售公司：</th>
            <td>
                <input id="xsht_wlfgs_id" name="xsht.wlfgs.id" type="hidden" class="input-text"
                       value="<#if xsht??>${(xsht.wlfgs.id)!}<#else>${(yg.zggs.id)!}</#if>"/>
                <input id="xsht_wlfgs_jc" type="text" class="input-text" readonly="readonly"
                       value="<#if xsht??>${(xsht.wlfgs.jc)!}<#else>${(yg.zggs.jc)!}</#if>"/>
            </td>
        </tr>
        <tr>
            <th>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</th>
            <td colspan="5">
                <textarea name="xsht.bz" rows="4" cols="45" class="textarea"
                          style="width: 91%">${(xsht.bz)!}</textarea>
            </td>
        </tr>
    </table>
    <div id="xsht-fileQueue" class="fileQueue" style="float: left;margin-left:80px">
    <#if xsht??>
        <#list xsht.fjList as fj>
            <div id="xsht-files${fj.id}" class="uploadify-queue-item">
                <div class="cancel">
                    <a href="javascript:void(0)" onclick="deleteXshtFile('${fj.id}','xsht-files${fj.id}')">X</a>
                </div>
                <span class="fileName">${(fj.ccmc)!}</span><span class="data"></span>
            </div>
            <input type="hidden" id="xsht-file${fj.id}" name="xsht.fjList.id" value="${(fj.id)!}"/>
        </#list>
    </#if>
    </div>
    <div style="float: right;margin: 8px 15px 0 0;">
        <input type="file" name="file" id="xsht-uploadify"/>
    </div>

</div>
<div title="合同明细">
<#--<div id="xshtgl_xshtmx_toolbar">-->
<#--<div class="PTools">-->
<#--<ul class="niu">-->
<#--<li><a name="xzxshtmx" href="javascript:void(0);" plain="true">新增合同明细</a></li>-->
<#--<li><a name="scxshtmx" href="javascript:void(0);" class="del" plain="true">删除合同明细</a></li>-->
<#--</ul>-->
<#--</div>-->
<#--</div>-->
    <table id='xsht_mx'>
    </table>
</div>
<div title="公式选择" style="height:100%">
    <table id="xsht_gspzList"></table>
</div>
<div title="合同文本" style="overflow:hidden">
    <div id="-toolbar">
        <div class="PTools">
            <ul class="niu">
                <li><span class="xuan">选择合同模板：</span>
                    <input id="xsht_htmb_id" name="xsht_htmb" type="text" class="searchinput-text">
                </li>
                <li><a class="she" href="javascript:void(0);" onclick="checkIsInstall('')">检查插件</a></li>
                <li><a class="watch" href="javascript:void(0);"
                       onclick="printPreview('${(xshtHtbm)!}','${(xshtEmwtime)!}','')">打印预览</a></li>
                <li><a class="pen" href="javascript:void(0);"
                       onclick="print('${(xshtHtbm)!}','${(xshtEmwtime)!}','')">打印</a></li>
                <li><a class="baocun" href="javascript:void(0);" onclick="htwb_save('xsht')">保存合同</a></li>
                <li><a class="baocun" href="javascript:void(0);" onclick="htmb_save()">另存为模板</a>
                    <input id="cght_mbname" name="cght_mbname" type="text" class="searchinput-text"/>
                </li>
            </ul>
        </div>
    </div>
    <div style="overflow:auto;height:90%">
        <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
            <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0
                   pluginspage="install_lodop32.exe"></embed>
        </object>
        <div id="htwb_xsht_id" class="textcon">

        </div>
    </div>

</div>

</form>
